<template>
	<view class="safe-area-inset-bottom">
		<!-- 搜索框 -->
		<view class="swip_header">
			<view class="slot-box">
				<view style="width: 100%;">
					<uni-search-bar v-model="queryParams.params.findApi" type="text" @confirm="handleQuery"
						@input="handleQuery" placeholder="请输入订单编号或名称" />
				</view>
				</view>
		</view>
		
<view class="scroll_view">
		<view v-if="payStaffList.length !== 0">
			<view class="table_view" @click="selectChange(item)" v-for="(item, index) in payStaffList" :key="index">
				<span style="width: 30%;">
				<i class="iconfont grayIcon" style="margin:0 10rpx 0 0;font-size: 30rpx;" v-if="item.isCertify == 0">&#xe625;</i>
				<i class="iconfont greenIcon" style="margin:0 10rpx 0 0;font-size: 27rpx;" v-else>&#xe625;</i>
				{{item.name}}
				</span>
				<span>{{item.mobile}}</span>
				<span>{{item.staffPost}}</span>
				<span style="color: #00a660;">使用</span>
			</view>
		</view>
			<!-- 暂无数据 -->
			<luanqingEmpty :show="true" text="没有更多数据啦" v-else />
		</view>
	</view>
</template>

<script>
	import luanqingEmpty from '@/components/luanqing-empty/luanqing-empty';
	import {listCompanyPayStaffForEc} from "@/api/ec/console/busiConfig/companyPayStaff";
	export default {
		name:"selectPayerStaff",
		components:{luanqingEmpty,},
		data() {
			return {
				payerInfo:'',
				searchValue: '', //搜索框内容
				payStaffList: [],
				// 查询参数
				queryParams: {
				  pageNum: 1,
				  pageSize: 10,
				  params: {
				    findApi: undefined
				  }
				},      
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			/** 查询员工列表 */
			getList() {
        this.$modal.loading();
			  listCompanyPayStaffForEc(this.queryParams).then(response => {
				  uni.hideLoading()
			         this.payStaffList = response.rows;
			       });
			},    
			/**搜索*/
			handleQuery(){
				this.getList()
			},			
			/** 选择使用联系人 */
			selectChange(item){
				uni.$emit("payInfo",item)
				uni.navigateBack({
					delta:1
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {background:$uni-bg-color;}
	.scroll_view{
		position: absolute;
		top: 110rpx;
		height:80%;
		width: 100%;
		overflow-y: scroll;
	}
.table_view{
	height: 100rpx;
	line-height: 100rpx;
	border-bottom: 1rpx solid #ebeef5;
	padding: 0 20rpx 0 0;
	display: flex;
	justify-content: space-between;
	margin:0 20rpx;
}	
</style>